home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / gemlib / gmlibs23.zoo / gemfast.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-27  |  11.7 KB  |  499 lines

  1. #ifndef _GEMFAST_H
  2. #define _GEMFAST_H
  3.  
  4. #if defined(__cplusplus)
  5. extern "C" {
  6. #endif
  7.  
  8. /**************************************************************************
  9.  *
  10.  * GEMFAST.H - Header file for common VDI and AES symbols.    
  11.  *
  12.  *  This header file contains items compatible with both GEMDEFS and OBDEFS
  13.  *  from the Alcyon system.  Note that there are no 'extern' definitions
  14.  *  for the functions, because they all return a signed short and work
  15.  *  fine as autodefined functions.
  16.  *
  17.  *  If you have a lot of source already coded for #include <gemdefs.h>,
  18.  *  you can continue to use your original gemdefs file, or you can rename
  19.  *  this file to gemdefs.h; if your source also includes obdefs.h, remove
  20.  *  them when using this file.
  21.  *  (i have links called obdefs and gemdefs, since this file is now protected
  22.  *   against multiple inclusions -- ++jrb)
  23.  *
  24.  * Credits dept:
  25.  *    This file bears an amazing similarity to the original Alcyon GEMDEFS
  26.  *    and OBDEFS header files, which are copyrighted by Atari.  What can I
  27.  *    say?  Copyrighted or not, these are the names and values that every-
  28.  *    body uses, so of course the files look *awful* similar...
  29.  *
  30.  *************************************************************************/
  31.  
  32.         /* evnt_multi flags */
  33. #define MU_KEYBD    0x0001
  34. #define MU_BUTTON    0x0002
  35. #define MU_M1        0x0004
  36. #define MU_M2        0x0008
  37. #define MU_MESAG    0x0010
  38. #define MU_TIMER    0x0020
  39.         /* keyboard states */
  40. #define K_RSHIFT    0x0001
  41. #define K_LSHIFT    0x0002
  42. #define K_CTRL         0x0004
  43. #define K_ALT        0x0008
  44.         /* event message values */
  45. #define MN_SELECTED    10
  46. #define WM_REDRAW    20
  47. #define WM_TOPPED    21
  48. #define WM_CLOSED    22
  49. #define WM_FULLED    23
  50. #define WM_ARROWED    24
  51. #define WM_HSLID    25
  52. #define WM_VSLID    26
  53. #define WM_SIZED    27
  54. #define WM_MOVED    28
  55. #define WM_NEWTOP    29
  56. #define AC_OPEN        40
  57. #define AC_CLOSE    41
  58.         /* form_dial opcodes */
  59. #define FMD_START    0
  60. #define FMD_GROW    1
  61. #define FMD_SHRINK    2
  62. #define FMD_FINISH    3
  63.         /* rsrc_gaddr structure types */
  64. #define R_TREE         0 
  65. #define R_OBJECT    1
  66. #define R_TEDINFO    2
  67. #define R_ICONBLK    3
  68. #define R_BITBLK    4
  69. #define R_STRING    5
  70. #define R_IMAGEDATA 6
  71. #define R_OBSPEC    7
  72. #define R_TEPTEXT    8
  73. #define R_TEPTMPLT    9
  74. #define R_TEPVALID    10
  75. #define R_IBPMASK    11 
  76. #define R_IBPDATA    12    
  77. #define R_IBPTEXT    13
  78. #define R_BIPDATA    14
  79. #define R_FRSTR        15
  80. #define R_FRIMG        16 
  81.         /* Window Attributes */
  82. #define NAME        0x0001
  83. #define CLOSER         0x0002
  84. #define FULLER         0x0004
  85. #define MOVER        0x0008
  86. #define INFO        0x0010
  87. #define SIZER        0x0020
  88. #define UPARROW        0x0040
  89. #define DNARROW        0x0080
  90. #define VSLIDE         0x0100
  91. #define LFARROW        0x0200
  92. #define RTARROW        0x0400
  93. #define HSLIDE         0x0800
  94.         /* wind_create flags */
  95. #define WC_BORDER    0
  96. #define WC_WORK        1
  97.         /* wind_get flags */
  98. #define WF_KIND         1
  99. #define WF_NAME         2
  100. #define WF_INFO         3
  101. #define WF_WORKXYWH      4
  102. #define WF_CURRXYWH     5
  103. #define WF_PREVXYWH      6
  104. #define WF_FULLXYWH      7
  105. #define WF_HSLIDE    8
  106. #define WF_VSLIDE    9
  107. #define WF_TOP          10
  108. #define WF_FIRSTXYWH     11
  109. #define WF_NEXTXYWH      12
  110. #define WF_RESVD    13
  111. #define WF_NEWDESK    14
  112. #define WF_HSLSIZE    15
  113. #define WF_VSLSIZE    16
  114. #define WF_SCREEN    17
  115.         /* arrow message    */
  116. #define WA_UPPAGE     0
  117. #define WA_DNPAGE     1
  118. #define WA_UPLINE     2
  119. #define WA_DNLINE     3
  120. #define WA_LFPAGE     4
  121. #define WA_RTPAGE     5
  122. #define WA_LFLINE     6
  123. #define WA_RTLINE     7
  124.  
  125.         /* wind_update flags */
  126. #define END_UPDATE    0
  127. #define BEG_UPDATE    1
  128. #define END_MCTRL    2
  129. #define BEG_MCTRL    3
  130.         /* graf_mouse mouse types*/
  131. #define ARROW        0
  132. #define BEE        2
  133. #define BUSY_BEE    BEE        /* alias */
  134. #define TEXT_CRSR    1
  135. #define HOURGLASS    2
  136. #define POINT_HAND    3
  137. #define FLAT_HAND    4
  138. #define THIN_CROSS    5
  139. #define THICK_CROSS    6
  140. #define OUTLN_CROSS     7
  141. #define USER_DEF    255
  142. #define M_OFF        256
  143. #define M_ON        257
  144.         /* objects - general */
  145. #define ROOT 0                /* index of ROOT            */
  146. #define MAX_LEN     81        /* max string length        */
  147. #define MAX_DEPTH    8        /* max depth of search or draw  */
  148.         /* inside fill patterns    */
  149. #define IP_HOLLOW    0
  150. #define IP_1PATT    1
  151. #define IP_2PATT    2
  152. #define IP_3PATT    3
  153. #define IP_4PATT    4
  154. #define IP_5PATT    5
  155. #define IP_6PATT    6
  156. #define IP_SOLID    7
  157.         /* normal graphics drawing modes */
  158. #define MD_REPLACE    1
  159. #define MD_TRANS    2
  160. #define MD_XOR         3
  161. #define MD_ERASE    4
  162.  
  163.         /* bit blt rules */
  164. #define ALL_WHITE    0
  165. #define S_AND_D        1
  166. #define S_AND_NOTD    2
  167. #define S_ONLY         3
  168. #define NOTS_AND_D    4
  169. #define D_ONLY         5
  170. #define S_XOR_D        6
  171. #define S_OR_D         7
  172. #define NOT_SORD    8
  173. #define NOT_SXORD    9
  174. #define D_INVERT    10
  175. #define NOT_D        10
  176. #define S_OR_NOTD    11
  177. #define NOT_S        12
  178. #define NOTS_OR_D    13
  179. #define NOT_SANDD    14
  180. #define ALL_BLACK    15
  181.  
  182.         /* font types */
  183. #define IBM 3
  184. #define SMALL 5
  185.  
  186.         /* object types */
  187. #define G_BOX        20
  188. #define G_TEXT         21
  189. #define G_BOXTEXT    22
  190. #define G_IMAGE        23
  191. #define G_USERDEF    24
  192. #define G_IBOX         25
  193. #define G_BUTTON    26
  194. #define G_BOXCHAR    27
  195. #define G_STRING    28
  196. #define G_FTEXT        29
  197. #define G_FBOXTEXT    30
  198. #define G_ICON         31
  199. #define G_TITLE        32
  200.         /* object flags */
  201. #define NONE        0x0000
  202. #define SELECTABLE    0x0001
  203. #define DEFAULT        0x0002
  204. #define EXIT        0x0004
  205. #define EDITABLE    0x0008
  206. #define RBUTTON        0x0010
  207. #define LASTOB         0x0020
  208. #define TOUCHEXIT    0x0040
  209. #define HIDETREE    0x0080
  210. #define INDIRECT    0x0100
  211.         /* Object states */
  212. #define NORMAL         0x0000
  213. #define SELECTED    0x0001
  214. #define CROSSED        0x0002
  215. #define CHECKED        0x0004
  216. #define DISABLED    0x0008
  217. #define OUTLINED    0x0010
  218. #define SHADOWED    0x0020
  219.         /* Object colors - default pall. */
  220. #define WHITE    0
  221. #define BLACK    1
  222. #define RED      2
  223. #define GREEN    3
  224. #define BLUE     4
  225. #define CYAN     5
  226. #define YELLOW   6
  227. #define MAGENTA  7
  228. #define LWHITE   8
  229. #define LBLACK   9
  230. #define LRED     10
  231. #define LGREEN   11
  232. #define LBLUE    12
  233. #define LCYAN    13
  234. #define LYELLOW  14
  235. #define LMAGENTA 15
  236.         /* editable text field definitions */
  237. #define EDSTART        0
  238. #define EDINIT         1
  239. #define EDCHAR         2
  240. #define EDEND        3
  241.         /* editable text justification */
  242. #define TE_LEFT        0
  243. #define TE_RIGHT    1
  244. #define TE_CNTR        2
  245.  
  246.         /* file attr for dos_create    */
  247. #define    F_ATTR        0    
  248.  
  249.         /* VDI Memory Form Definition Block */
  250.  
  251. #if !defined(__MFDB__) && !defined(_ALT_MFDB) && !defined(__ALT_MFDB__)
  252. #define __MFDB__
  253.  
  254. typedef struct
  255. {
  256.     long        fd_addr;    /* Addrerss of upper left corner of first*/
  257.                                     /* plane of raster area. If NULL then   */
  258.                                     /* MFDB is for a physical device        */
  259.     short        fd_w;        /* Form Width in Pixels                 */
  260.     short        fd_h;       /* Form Height in Pixels                */
  261.     short        fd_wdwidth; /* Form Width in shorts(fd_w/sizeof(int)*/
  262.     short        fd_stand;   /* Form format 0= device spec 1=standard*/
  263.     short        fd_nplanes; /* Number of memory planes              */
  264.     short        fd_r1;      /* Reserved                             */
  265.     short        fd_r2;      /* Reserved                             */
  266.     short        fd_r3;      /* Reserved                             */
  267. } MFDB;
  268. #endif    /* __MFDB__ */
  269.  
  270. #ifdef __ALT_MFDB__
  271. /* some software seems to wants this format for FDB. to get it, define
  272.    __ALT_MFDB__
  273.  */
  274. #ifdef __MFDB__
  275. # error conflicting types for MFDB
  276. #endif
  277.  
  278. #define __MFDB__
  279. typedef struct
  280. {
  281.     long    mp;
  282.     short    fwp;
  283.     short    fh;
  284.     short    fww;
  285.     short    ff;
  286.     short    np;
  287.     short    r1;
  288.     short    r2;
  289.     short    r3;
  290. } MFDB;
  291. #endif /* __ALT_MFDB__ */
  292.  
  293.         /* Mouse Form Definition Block */
  294. typedef struct mouse_form
  295.     {
  296.     short    mf_xhot;
  297.     short     mf_yhot;
  298.     short     mf_nplanes;
  299.     short    mf_bg;
  300.     short     mf_fg;
  301.     short     mf_mask[16];
  302.     short     mf_data[16];
  303.     } MFORM ;
  304.  
  305. typedef struct mouse_event_type
  306.     {
  307.     int    *x;
  308.     int     *y;
  309.     int    *b;
  310.     int    *k;
  311.     } Mouse;
  312.  
  313. typedef struct graphic_rectangle
  314.     {    /* note these three rect structs are deliberately ints */
  315.     int g_x;
  316.     int g_y;
  317.     int g_w;
  318.     int g_h;
  319.     } GRECT;
  320.  
  321. typedef struct vdi_rectangle
  322.     {
  323.     int v_x1;
  324.     int v_y1;
  325.     int v_x2;
  326.     int v_y2;
  327.     } VRECT;
  328.  
  329. typedef struct orect
  330. {
  331.         struct orect    *o_link;
  332.     int    o_x;
  333.     int    o_y;
  334.     int    o_w;
  335.     int    o_h;
  336. } ORECT;
  337.  
  338. typedef struct rect_for_rect_utils
  339.     {    /* note these three rect structs are deliberately ints */
  340.     int x;
  341.     int y;
  342.     int w;
  343.     int h;
  344.     } Rect;
  345.  
  346. typedef struct text_edinfo
  347.     {
  348.     char *te_ptext;            /* ptr to text             */
  349.     char *te_ptmplt;        /* ptr to template            */
  350.     char *te_pvalid;        /* ptr to validation chrs.   */
  351.     short    te_font;        /* font                    */
  352.     short    te_junk1;         /* junk word                */
  353.     short    te_just;        /* justification            */
  354.     short    te_color;         /* color information word    */
  355.     short    te_junk2;         /* junk word                */
  356.     short    te_thickness;        /* border thickness         */
  357.     short    te_txtlen;        /* length of text string     */
  358.     short    te_tmplen;        /* length of template string */
  359.     } TEDINFO;
  360.  
  361. typedef struct icon_block
  362.     {
  363.     short    *ib_pmask;
  364.     short    *ib_pdata;
  365.     char     *ib_ptext;
  366.     short    ib_char;
  367.     short    ib_xchar;
  368.     short    ib_ychar;
  369.     short    ib_xicon;
  370.     short    ib_yicon;
  371.     short    ib_wicon;
  372.     short    ib_hicon;
  373.     short    ib_xtext;
  374.     short    ib_ytext;
  375.     short    ib_wtext;
  376.     short    ib_htext;
  377.         short   ib_resvd;
  378.     } ICONBLK;
  379.  
  380. typedef struct bit_block
  381.     {
  382.     char     *bi_pdata;            /* ptr to bit forms data  */
  383.     short    bi_wb;                /* width of form in bytes */
  384.     short    bi_hl;                /* height in lines */
  385.     short    bi_x;                /* source x in bit form     */
  386.     short    bi_y;                /* source y in bit form     */
  387.     short    bi_color;             /* fg color of blt */
  388.  
  389.     } BITBLK;
  390.  
  391. typedef struct user_block
  392.     {
  393.         int  (*ub_code)(void *parmblock); /* really PARMBLK *parmblock */
  394.     long ub_parm;
  395.     } USERBLK;
  396.  
  397. #ifndef __TCC_COMPAT__
  398. typedef struct object
  399.     {
  400.     short    ob_next;    /* -> object's next sibling            */
  401.     short    ob_head;    /* -> head of object's children       */
  402.     short    ob_tail;    /* -> tail of object's children       */
  403.     unsigned short ob_type;    /* type of object              */
  404.     unsigned short ob_flags;/* flags                  */
  405.     unsigned short ob_state;/* state                  */
  406.     unsigned long  ob_spec;    /* object-specific data              */
  407.     short    ob_x;        /* upper left corner of object           */
  408.     short    ob_y;        /* upper left corner of object           */
  409.     short    ob_width;     /* width of obj                  */
  410.     short    ob_height;    /* height of obj              */
  411.     } OBJECT;
  412. #else
  413.  
  414. typedef struct {
  415.     unsigned short character   :  8;
  416.     signed   short framesize   :  8;
  417.     unsigned short framecol    :  4;
  418.     unsigned short textcol     :  4;
  419.     unsigned short textmode    :  1;
  420.     unsigned short fillpattern :  3;
  421.     unsigned short interiorcol :  4;
  422. } bfobspec;
  423.  
  424. typedef union __u_ob_spec {
  425.     TEDINFO        *tedinfo;
  426.     long        index;
  427.     char        *free_string;
  428.     union __u_ob_spec *indirect;
  429.         bfobspec    obspec;
  430.     BITBLK        *bitblk;
  431.     ICONBLK        *iconblk;
  432.         USERBLK     *userblk;
  433. /*    APPLBLK        *applblk;
  434.     char        *string;    */
  435. } U_OB_SPEC;
  436.  
  437. typedef struct object
  438.     {
  439.     short    ob_next;    /* -> object's next sibling            */
  440.     short    ob_head;    /* -> head of object's children       */
  441.     short    ob_tail;    /* -> tail of object's children       */
  442.     unsigned short ob_type;    /* type of object              */
  443.     unsigned short ob_flags;/* flags                  */
  444.     unsigned short ob_state;/* state                  */
  445.     U_OB_SPEC      ob_spec;    /* object-specific data              */
  446.     short    ob_x;        /* upper left corner of object           */
  447.     short    ob_y;        /* upper left corner of object           */
  448.     short    ob_width;     /* width of obj                  */
  449.     short    ob_height;    /* height of obj              */
  450.     } OBJECT;
  451. #endif
  452.  
  453. typedef struct parm_block
  454.     {
  455.     OBJECT     *pb_tree;
  456.     short    pb_obj;
  457.     short    pb_prevstate;
  458.     short    pb_currstate;
  459.     short    pb_x, pb_y, pb_w, pb_h;
  460.     short    pb_xc, pb_yc, pb_wc, pb_hc;
  461.     long     pb_parm;
  462.     } PARMBLK;
  463.  
  464.                         /* used in RSCREATE.C    */
  465. typedef struct rshdr
  466. {
  467.     short        rsh_vrsn;
  468.     unsigned short    rsh_object;
  469.     unsigned short    rsh_tedinfo;
  470.     unsigned short    rsh_iconblk;    /* list of ICONBLKS        */
  471.     unsigned short    rsh_bitblk;
  472.     unsigned short    rsh_frstr;    
  473.     unsigned short    rsh_string;
  474.     unsigned short    rsh_imdata;    /* image data            */
  475.     unsigned short    rsh_frimg;    
  476.     unsigned short    rsh_trindex;
  477.     short        rsh_nobs;    /* counts of various structs    */
  478.     short        rsh_ntree;
  479.     short        rsh_nted;
  480.     short        rsh_nib;
  481.     short        rsh_nbb;
  482.     short        rsh_nstring;
  483.     short        rsh_nimages;
  484.     unsigned short    rsh_rssize;    /* total bytes in resource    */
  485. } RSHDR;
  486.  
  487. #define DESKTOP_HANDLE 0
  488.  
  489. /* (user visible) binding arrays */
  490. extern short         _intin[], _intout[], _ptsin[], _ptsout[];
  491. extern void          *_addrin[], *_addrout[];
  492. extern int        gl_apid, gl_ap_version;
  493.  
  494. #if defined(__cplusplus)
  495. }
  496. #endif
  497.  
  498. #endif /* _GEMFAST_H */
  499.